package com.heima.article.job;

import com.heima.article.service.HotArticlesService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @作者 itcast
 * @创建日期 2021/2/24 14:15
 **/
@Component
@Slf4j
public class ComputeHotArticleJob {
    @Autowired
    HotArticlesService hotArticlesService;
    @XxlJob("computeHotArticleJob")
    public ReturnT computeHotArticleJob(String params){
        log.info(" 开始 统计近5天 热点文章=========>start");
        hotArticlesService.computeHotArticle();
        log.info(" 结束 统计近5天 热点文章=========>end");
        return ReturnT.SUCCESS;
    }
}
